<?php
include ('input.php');
$ok=include ('db.php');
//var_dump($ok);
$contact=$input->post('contact');
$user=$input->post('user');
if($user=='' || $contact=='') {
    echo '留言内容和用户名不能为空';
}else{
    $tim=time();
    $sql="INSERT INTO msg(username,contact,time) VALUES('{$user}','{$contact}','{$tim}')";
    $is=$mysql->query($sql);
    if($is){
        header('location:4.php');
    };
}
?>